package vip.zhenzicheng.design_patterns.flyweight.jdk;

/**
 * Integer中存在-128~127的常量缓存
 *
 * @author zhenzicheng
 * @date 2022-05-26 17:36
 */
public class Demo {
  public static void main(String[] args) {
    Integer i1 = 127;
    Integer i2 = 127;

    System.out.println("i1和i2对象是否是同一个对象？" + (i1 == i2));

    Integer i3 = 128;
    Integer i4 = 128;

    System.out.println("i3和i4对象是否是同一个对象？" + (i3 == i4));
  }
}
